<template>
	<view class="update-page">
		<view class="update-page__content">
			<view></view>
			<view class="item">
				<text>1.新增黑科技，升级即可体验</text>
			</view>
			<view class="item">
				<text>2.修复已知BUG，应用更顺畅</text>
			</view>
			<view class="item">
				<text>3.界面设计视觉优化，体验更友好</text>
			</view>
			<view class="item btn">
				<button type="primary" style="background-color: #ff8200;color:#000; font-size: 30rpx;" @click="updateHandler">立即升级</button>
			</view>
			<view class="btn-box" v-if="is_download === true">
				<view class="progress-box" v-if="is_fail == false">
					<view class="progress-text">
						正在下载中：{{progress}} %
					</view>
					<view class="uni-padding-wrap uni-common-mt progress">
						<view class="progress-box">
							<progress :percent="progress" backgroundColor="#e3e3e3" stroke-width="4" />
						</view>
					</view>
				</view>
				<view v-else>
					<view class="progress-text red">
						下载失败
					</view>
					
				</view>
			</view>
		</view>
	</view>
	
</template>

<script>
	/**
	 * 获取当前app的版本名称，通过接口比对当前app版本名称和线上最新版本名称，
	 * 如果线上最新版本名称大于当前版本名称则下载最新的apk安装更新
	 * 
	 */
	import ApkUpdate from './ApkUpdate'
	export default {
		mixins: [ApkUpdate],
		data() {
			return {
				
			}
		},
		methods: {
			updateHandler() {
				this.$emit("update")
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	.update-page {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		width: 100%;
		height: 400rpx;
		
	}
	.update-page__content {
		// width: 300rpx;
		// height: 400rpx;
		
		// border: 1px solid #ddd;
		// background: #eee;
		// border-radius: 20rpx;
		
	}
	.item {
		margin: 30rpx;
		font-size: 26rpx;
		color: #000;
		font-weight: 700;
	}

</style>
